import setTing from '../appSetting'
import request from './request'
const publicFunction: any = {
    setDeletePageNum: (totalNum: string | number, pageSize = (setTing as any).paging.pageSize) => {
        let num = Math.ceil((Number(totalNum) - 1) / Number(pageSize))
        return num > 0 ? num : 1
    },
    upLoadFiles: (file: any, callBack: any) => {
        let formdata = new FormData()
        formdata.append('file', file)
        request.uploading('/api/oa/users/uploadPicture', formdata).then((res: any) => {
            if (res.code == 200) {
                callBack(res.data)
            }
        })
    }
}
export default publicFunction
